package edu.lingnan.librarymanage.core.dto;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;

/**
 * @author cql
 */
@Data
public class RegisterDTO {


    @Pattern(regexp = "^[a-zA-Z0-9]{11}$", message = "请设置英文或数字共11位字符的账号")
    private String account;

    @Pattern(regexp = "^[a-zA-Z0-9]{6,20}$", message = "请设置包含数字或英文的6到20个字符的密码")
    private String password;

    @Pattern(regexp = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", message = "请填写正确的邮箱地址")
    private String email;

    @Min(value = 0, message = "请设置性别")
    @Max(value = 1, message = "请设置性别")
    private Integer gender;

}
